var React = require('react');
var PageView = require('../../controls/PageView');

var TableView = require('./TableView');
module.exports = React.createClass({
	getInitialState: function () {
		return {
			db: null,
			toolbarItems: [
				{ text: '创建数据库', icon: 'fa-plus', onClick: this.__onAdd },
				{ text: '删除数据库', icon: 'fa-minus', status: 'danger' }
			],
			formItems: [
				{ title: 'dbName', name:'Name', type:'text' }
			]
		}
	},
	componentDidMount:function(){

	},
	render:function(){
		return (
			<PageView
				hHeight={48}
				icon={this.props.icon}
				title={this.props.title}
				toolbarItems={this.state.toolbarItems}
				toolbarItemFloatDirection="right">
				<li className="flex-item">
					<input type="search" placeholder="Search Data Base" name="search" style={{width: 200, height: 35 }} />
				</li>
				<TableView db={this.state.db||'tuanjian'} />
			</PageView>
		);
	}
});
